package com.my.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.my.bean.LiuYan;
import com.my.dao.IBaseDAO;
import com.my.dao.LiuYanDAO;

public class LiuYanDAOImpl extends HibernateDaoSupport implements LiuYanDAO {

	private IBaseDAO<LiuYan> baseDAO;

	public void setBaseDao(IBaseDAO<LiuYan> baseDAO) {
		this.baseDAO = baseDAO;
	}

	@Override
	public boolean add(LiuYan liuYan) throws Exception {
		if (liuYan == null) {
			return false;
		}
		return baseDAO.add(liuYan);
	}

	@Override
	public List<LiuYan> getAllLiuYan() throws Exception {
		String hql = "from LiuYan";
		return baseDAO.getList(hql);
	}

	@Override
	public LiuYan getLiuYanById(Class<LiuYan> liuYan, Integer id)
			throws Exception {
		return baseDAO.getById(liuYan, id);
	}

}
